<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="../js/vue.js"></script>
	</head>
	<body>
		<div id="root">
			<h2>人员信息</h2>
			<button @click="handleClick">修改第一个人的信息</button>
			<ul>
				<!-- <li v-for="p in persons" :key="p.id"> -->
				<li v-for="(p,index) of persons" :key="index">
					{{p.name}}-{{p.age}}
				</li>
			</ul>
		</div>
	</body>
	<script>
		// #region
		const wm = new Vue({
			el: '#root',
			data() {
				return {
					persons: [{
							id: '001',
							name: '张三',
							age: 13
						},
						{
							id: '002',
							name: '李四',
							age: 11
						},
						{
							id: '003',
							name: '王五',
							age: 12
						}
					],
					keyword: '',
					order:0, //0原顺序 1升序 2降序
					// filterPersons:[]
				}
			},
			methods:{
				handleClick(){
					// this.persons[0].name = '赵六'
					// this.persons[0].age = 20
					this.persons[0] = {id:'001',name:'赵六',age:20}
				}
			}
		})
		
		//#endregion
	</script>
</html>